﻿using System.Collections.Generic;
using NTTDATA.BEENChina.ResultCertification.Checker;
using NTTDATA.BEENChina.ResultCertification.DataStore;
using NTTDATA.BEENChina.ResultCertification.model;

namespace NTTDATA.BEENChina.ResultCertification.Config
{
 
    public  class CategoryConfig
    {
       
        public string CategoryId { get;   set; }
      
        public string CategoryName { get;   set; }
      
        public EnumCategoryType CategoryType { get; set; }

        /// <summary>
        /// 录入结果的分割字符串
        /// 从录入结果中 提取一组需要检验的对象所依赖的相关字符串
        /// </summary>
        public string SplitFormat { get;   set; }

        /// <summary>
        /// categoryid 相关的检查类实例
        /// 
        /// 检查时使用
        /// </summary>
        public List<Verfity> Verfities { get;   set; }

       // public ISplit Split { get; set; }
        /// <summary>
        /// Category相关的检查类
        /// 配置时使用
        /// </summary>
        public List<VerfityItem> VerfityItems
        {
            get;
            set;
        }

        /// <summary>
        /// 字符串格式
        /// </summary>
        /// <example>
        /// "yyyy/mm/dd/ss"
        ///</example>
        public string DataFormat { get; set; }


        /// <summary>
        /// N行结果 属于一行
        /// </summary>
        public int Columns { get; set; }

        public string ResultFormate { get; set; }
        
        /// <summary>
        /// f_category_id 对应的 categoryid
        /// </summary>
        public string CaId { get; set; }

        private Dictionary<string, string> _gridItems = null;

        /// <summary>
        /// GridItems 表里的结果
        /// </summary>
        public  Dictionary<string, string> GridItems
        {
            get
            {
                if (_gridItems ==null &&  !string.IsNullOrEmpty(CaId))
                {
                    IGridItemsAccess gridItemsAccess = new GridItemsAccess();
                    _gridItems = gridItemsAccess.GetGridItems(CaId);
                }

                return _gridItems;
            }

            set { _gridItems = value; }
        }
    }
}
